<div class="extauthors form">
<?php echo $this->Form->create('Authorlink'); ?>
	<fieldset>
		<legend><?php echo __('Добавление соавтора студента'); ?></legend>
		<?php 
			echo $this->Form->hidden('recordid', array('value' => $record_id));
			echo $this->Form->hidden('recordtype_id', array('value' => $recordtype_id));
			echo $this->Form->hidden('authortype_id', array('value' => $authortype_id));
		?>
		<table width="100%" class="invisibletable">
  <tr>
    <td width="15%" align="right">Специальность</td>
    <td width="2%" align="right"><font color="red">*</font></td>
    <td width="45%"><?php   echo $this->Form->input('profession_id', array('empty' => 'Выберите специальность', 'label' => '')); ?>
	</td>
  </tr>
  <tr>
    <td width="15%" align="right">Курс</td>
    <td width="2%" align="right"><font color="red">*</font></td>
    <td width="45%">
    	<?php 
	    	echo $this->Form->input('course_id', array('label' => ''));
	    	$this->Js->get('#AuthorlinkProfessionId');
	    	$this->Js->event('change', $this->Js->request(array('controller'=>'authorlinks', 'action'=>'update_course'),
	    			array(
	    					'update'=>'#AuthorlinkCourseId',
	    					'async' => true,
	    					'method' => 'Post',
	    					'dataExpression'=>true,
	    					'data'=> $this->Js->serializeForm(array('isForm' => true,'inline' => true))
	    			)));
    	?>
	</td>
  </tr>
    <tr>
    <td width="15%" align="right">Группа</td>
    <td width="2%" align="right"><font color="red">*</font></td>
    <td width="45%">
    	<?php   
    		echo $this->Form->input('studentgroup_id', array('label' => ''));
			$this->Js->get('#AuthorlinkCourseId');
			$this->Js->event('change', $this->Js->request(array('controller'=>'authorlinks', 'action'=>'update_group'),
			array(
				'update'=>'#AuthorlinkStudentgroupId',
				'async' => true,
				'method' => 'Post',
				'dataExpression'=>true,
				'data'=> $this->Js->serializeForm(array('isForm' => true,'inline' => true))
			))); 
    	?>
	</td>
  </tr>
    <tr>
    <td width="15%" align="right">Студент</td>
    <td width="2%" align="right"><font color="red">*</font></td>
    <td width="45%">
    	<?php 
	    	echo $this->Form->input('student_id', array('label' => ''));
	    	$this->Js->get('#AuthorlinkStudentgroupId');
	    	$this->Js->event('change', $this->Js->request(array('controller'=>'authorlinks', 'action'=>'update_student'),
	    			array(
	    					'update'=>'#AuthorlinkStudentId',
	    					'async' => true,
	    					'method' => 'Post',
	    					'dataExpression'=>true,
	    					'data'=> $this->Js->serializeForm(array('isForm' => true,'inline' => true))
	    			)));
    	?>
	</td>
  </tr>  
  </table>
  </fieldset>
  <br />
  <?php echo $this->Form->end(__('Submit'));?>
